package com.shuiyun.jtt.message.jt808;

import com.shuiyun.jtt.anno.Message;
import com.shuiyun.jtt.enums.JT808;
import com.shuiyun.jtt.message.JTMessage;
import com.shuiyun.jtt.message.jt808.extend.Point;
import com.shuiyun.jtt.utils.codec.DataType;
import com.shuiyun.jtt.utils.codec.FieldValue;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * @author shuiyun
 * @description 设置多边形区域
 * @date 2022年5月2日22:22:44
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Message(JT808.设置多边形区域0x8604)
public class T8604 extends JTMessage {

    @FieldValue(type = DataType.DWORD,desc = "区域ID")
    private Integer areaId;


    @FieldValue(type = DataType.WORD,desc = "属性")
    private Integer attribute;

    @FieldValue(type = DataType.BCD8421,length = 6,desc = "开始时间(yyMMddHHmmss)",checkMethod = {"attribute","&!","1"})
    private String startTime;

    @FieldValue(type = DataType.BCD8421,length = 6,desc = "结束时间(yyMMddHHmmss)",checkMethod = {"attribute","&!","1"})
    private String endTime;

    @FieldValue(type = DataType.WORD,desc = "最高速度(km/h)",checkMethod = {"attribute","&!","2"})
    private Integer maxSpeed;

    @FieldValue(type = DataType.BYTE,desc = "超速持续时间(s)",checkMethod = {"attribute","&!","2"})
    private Integer duration;

    @FieldValue(type = DataType.LIST,lengthSize = 2,desc = "顶点项")
    private List<Point> points;

    @FieldValue(type = DataType.WORD,desc = "夜间限速(km/h)",checkMethod = {"attribute","&!","2"})
    private Integer nightSpeed;

    @FieldValue(type = DataType.STRING,lengthSize = 2,desc = "区域名称")
    private String name;
}
